Skip to content

dev: enhance help linters output on fast and auto-fix capabilities #5207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

alexandear
Copy link
Member

@alexandear alexandear commented Dec 9, 2024

The PR changes the output for the golangci-lint linters help command.
I think outputting [fast: false, auto-fix: false] is redundant, and help prints nothing if the linter is slow and does not have auto-fix. If a linter is fast, the command prints green [fast]. If a linter can auto fix, the command prints green [auto-fix]. If a linter is fast and has auto fix - [fast, auto-fix] in green.

Before image
After image

@alexandear alexandear force-pushed the dev-enhance-help-linters branch from 7f9d097 to a52e438 Compare December 9, 2024 11:25
@ccoVeille
Copy link
Contributor

ccoVeille commented Dec 9, 2024

I like the colors.

But there is something strange with the non-fast one. I find uneasy to visually spot the ones that are not available in fast mode.

@ccoVeille
Copy link
Contributor

Maybe [non-fast] in orange?

UI is never fun.

This is a random feedback, feel free to ignore or wait for ldez feedback

@ldez ldez self-requested a review December 9, 2024 11:57
@ldez ldez added the topic: cosmetic changes contain cosmetic improvements label Dec 9, 2024
@ldez
Copy link
Member

ldez commented Dec 9, 2024

This will make it more complex to filter linter with grep.
I prefer to be able to use grep over having colors.

Also, IMO, having different colors for "fast"/"slow" is not right because it will imply a negative impression of "slow" linters.

@alexandear
Copy link
Member Author

This will make it more complex to filter linter with grep.

Maybe we can introduce flags for this use case:

  • golangci-lint help linters --fast
  • golangci-lint help linters --auto-fix

@ldez
Copy link
Member

ldez commented Dec 9, 2024

This will not work because the help contains more than linters, so grep is still the best approach.

It will also create an unnecessary complexity just for a help command.

@ldez
Copy link
Member

ldez commented Dec 9, 2024

After more thinking, I have a better idea to solve the grep problem, I will do a PR on this topic.
With my approach, the missing boolean will not be a problem.

If my PR works, we will merge the 2 PRs.

@ldez
Copy link
Member

ldez commented Dec 9, 2024

I opened #5209

@ldez ldez added this to the next milestone Dec 9, 2024
@ldez
Copy link
Member

ldez commented Dec 9, 2024

new render:
Screenshot_20241209_182729

(note: I don't have the same color render as you)

Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ldez ldez merged commit 97987f9 into golangci:master Dec 9, 2024
15 checks passed
@ldez ldez modified the milestones: next, v1.63 Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: cosmetic changes contain cosmetic improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants